function mbfl_dialog_enable_programs () 
{
  #need stty
}

function mbfl_dialog_yes_or_no () 
{
  mbfl_mandatory_parameter(STRING, 1, prompt string)
  mbfl_optional_parameter(PROGNAME, 2, ${script_PROGNAME})
  local PROMPT="${PROGNAME}: ${STRING}? (yes/no) "
  local ANS=
  while IFS= read -r -e -p "$PROMPT" ANS && \
    test "$ANS" != 'yes' -a "$ANS" != 'no'
  do echo "${PROGNAME}: please answer yes or no."
  done
  test "$ANS" = yes
}

function mbfl_dialog_ask_password () 
{
  mbfl_mandatory_parameter(PROMPT, 1, prompt)
  local PASSWORD= STTY=
  STTY=$(mbfl_program_found stty) || exit $?
  echo -n "${prompt}: " >&2
  "$STTY" cbreak -echo </dev/tty >/dev/tty 2>&1
  IFS= read -rs PASSWORD
  "$STTY" -cbreak echo </dev/tty >/dev/tty 2>&1
  echo >&2
  printf %s "${PASSWORD}"
}
